/*
 * Copyright (c) 2021 Zsj. All rights reserved.
 */

package com.jzz.crawlerweb.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class MvcController {

    @GetMapping("/login/{type}")
    public String login(@PathVariable String type, Model model) {
        model.addAttribute("type", type);
        return "index";
    }

    @ResponseBody
    @RequestMapping("/logout")
    public String logout() {
        return "Logout success";
    }
}
